<template>
	<view v-if="show" style="box-sizing: border-box;padding:10rpx 24rpx 40rpx 24rpx">
		<view class="top-title">
			<view class="top-title-left">继续教育学习</view>
			<view 
				class="top-title-right" 
				@click="jumpCertificatePage"
			>
				全部证书
				<u-icon 
					size="28"
					color="#7f7f7f" 
					name="arrow-right" 
				/>
			</view>
		</view>
		<view  class="dedede">
			<view 
				  class="ededed"
			>
				您有证书待继教，请进入学习...
			</view>
			<view style=" margin: auto;">
				<view
					class="botton-buttom" 
					@click="jump()"
				>
					去学习
				</view>
			</view>
		</view>
	</view>
</template>


<script>
	import request from '@/pagesB/common/js/request/allRequest.js';

	export default {
		name: 'certificaterModal',
		props:{
			bool: { type: Boolean, default: false },
		},
		// 页面数据
		data() {
			return {
				show:0,
			}
		},
		// 数据监听
		watch: { 
			'bool':{
				handler(newV){
					if(newV){
						this.getCertificateShow()
					}
				}
			}
		},
		created(){ 
			this.getCertificateShow()
		},
		beforeDestroy(){},
		// 实例挂载完毕
		mounted() {},
		// 页面事件
		methods: { 
			jump(type){
				uni.setStorageSync('tab', 1)
				uni.setStorageSync('tabChild',this.show - 1)
				uni.switchTab({
					url:`/pages/education/index`
				})
			},
			jumpCertificatePage(){
				uni.setStorageSync('tab', 1)
				uni.setStorageSync('tabChild', 0)
				uni.switchTab({
					url:`/pages/education/index`
				})
			},
			getCertificateShow(){
				request.getCertificateType({
					data:{ },
					success:(res) => {
						this.show = parseInt(res.type)
					},
					fail:(err) => { }
				})
			}
		}
	}
</script>


<style lang="less" scoped>
	.dedede{
		box-sizing: border-box;
		padding: 40rpx 44rpx;
		background-color: #fff;
		border-radius: 18rpx;
		padding: 36rpx 26rpx;
	}
	.ededed{
		margin-bottom: 48rpx;
		font-size: 28rpx;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: #262626;
		line-height: 40rpx;
		text-align: center;
	}
	.botton-buttom{
		margin: auto;
		width: 614rpx;
		height: 70rpx;
		background: #00CA9A;
		border-radius: 35rpx;
		color: #fff;
		font-size: 26rpx;
		font-family: PingFangSC, PingFangSC-Medium;
		font-weight: 500;
		line-height: 70rpx;
		text-align: center;
		margin-top: 30rpx;
	}
	.line{
		border-top: 1px solid #f0f0f0;
		margin: 28rpx 0 24rpx 0;
	}
	.top-title{
		box-sizing: border-box;
		padding: 24rpx 0;
		display: flex;
		justify-content: space-between;
		.top-title-left{
			font-size: 32rpx;
			font-family: PingFangSC, PingFangSC-Medium;
			font-weight: bold;
			color: #262626;
			line-height: 44rpx;
		}
		.top-title-right{
			font-size: 26rpx;
			font-family: PingFangSC, PingFangSC-Regular;
			font-weight: 400;
			text-align: center;
			color: #7f7f7f;
			line-height: 44rpx;
		}
	}
</style>